//
//  CTMediator+runtimeStudyCTMediator.m
//  runtimeStudy_Example
//
//  Created by PF on 2021/12/23.
//  Copyright © 2021 孙奥. All rights reserved.
//

#import "CTMediator+runtimeCTMediator.h"

NSString * const kCTMediatorTarget = @"runtime";
//NSString * const kCTMediatorTarget = @"hitTest";

NSString * const kCTMediatorAction_viewController = @"viewController";
@implementation CTMediator (runtimeCTMediator)
-(UIViewController *)CTMediator_viewController
{
    UIViewController *viewController = [self performTarget:kCTMediatorTarget action:kCTMediatorAction_viewController params:nil shouldCacheTarget:NO];
    if ([viewController isKindOfClass:[UIViewController class]]) {
        // view controller 交付出去之后，可以由外界选择是push还是present
        return viewController;
    } else {
        // 这里处理异常场景，具体如何处理取决于产品
        return [[UIViewController alloc] init];
    }
}
@end
